Recreate watches on domain restore.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Wed, 17 Aug 2005 10:18:34 +0000 (10:18 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Wed, 17 Aug 2005 10:18:34 +0000 (10:18 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
linux-2.6-xen-sparse/include/asm-xen/xenbus.h

index e5c625d752879f0d423a6bc8624b389f33e6373f..63923361a1374f5ca1be5bf966a598a6e5924b8f 100644 (file)
@@ -309,6 +309,7 @@ void xenbus_suspend(void)
 void xenbus_resume(void)
 {
        xb_init_comms();
+       reregister_xenbus_watches();
        up(&xenbus_lock);
 }
 
index 211677b35d2d82cf0cc8c7b813c6a27552458936..2e9c79361df03a78627babf72cde4bc60e9e6a9a 100644 (file)
@@ -496,6 +496,18 @@ void unregister_xenbus_watch(struct xenbus_watch *watch)
                       watch->node, err);
 }
 
+/* Re-register callbacks to all watches. */
+void reregister_xenbus_watches(void)
+{
+       struct xenbus_watch *watch;
+       char token[sizeof(watch) * 2 + 1];
+
+       list_for_each_entry(watch, &watches, list) {
+               sprintf(token, "%lX", (long)watch);
+               xs_watch(watch->node, token);
+       }
+}
+
 static int watch_thread(void *unused)
 {
        for (;;) {
index 8e9593ff907507d4588dc28fc993ddae997f9a38..8ffbcb75ef0a1ec5d7189b3c4562b40e45a9d721 100644 (file)
@@ -121,6 +121,7 @@ void unregister_xenstore_notifier(struct notifier_block *nb);
 
 int register_xenbus_watch(struct xenbus_watch *watch);
 void unregister_xenbus_watch(struct xenbus_watch *watch);
+void reregister_xenbus_watches(void);
 
 /* Called from xen core code. */
 void xenbus_suspend(void);